import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -05
 * Time: 17:47
 */
public class Test {
    public static boolean login(){
        Scanner sc=new Scanner(System.in);
        System.out.print("Please input the password:");
        String pw=sc.nextLine();
        if(!pw.equals("123456")){
            throw new RuntimeException("password error!");
        }
        return true;
    }

    public static void main(String[] args) {
        try{
            if(login()){
                System.out.println("login success!");
            }
        }catch(RuntimeException e){
            e.printStackTrace();
            System.out.println("login fail");
        }
    }
}
